<template>
<div class="count">
        <h1 ref="countEle">{{count}}</h1>
        <button @click='add'>累加</button>
        <button @click='yin'>获取refs</button>
        <h1>{{id}}-{{name}}-{{age}}</h1>
</div>

</template>

<script>
export default {
    name:'MyCount',
    props:['id','name','age'],
    data(){
        return{
            count:0
        }
    },
    methods:{
        add(){
            this.count++
        },
        yin(){
            //实例上的$refs.xxx获取，得到一个真实的DOM（）
            console.log(this.$refs.countEle);
        }
    },
}
</script>

<style>
    .count{
        background-color: aquamarine;
        height: 100px;
    }
</style>